<?php

// 获取会员账户
// GET member.account

namespace app\api\resource\member;
use think\Db;
use think\Session;

class Account
{
    // 方法
    public $_method = ['GET'];
    // 前置
    public $_pre    = ['login'];
    // 描述
    public $_description = '获取会员账户';
    // 参数
    public $_param  = [
    ];
    // 返回
    public $_return = [
        200 => '获取成功',
    ];

    public function run(&$request)
    {
        $memberId = Session::get('member.id');
        $account = Db::name('member')->where('id',$memberId)->value('account');
        return [200,$account];
    }
}